﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000438 RID: 1080
	[DisallowMultipleComponent]
	public class ObservableParticleTrigger : ObservableTriggerBase
	{
		// Token: 0x060016B1 RID: 5809 RVA: 0x0006231C File Offset: 0x0006071C
		private void OnParticleCollision(GameObject other)
		{
			if (this.onParticleCollision != null)
			{
				this.onParticleCollision.OnNext(other);
			}
		}

		// Token: 0x060016B2 RID: 5810 RVA: 0x00062338 File Offset: 0x00060738
		public IObservable<GameObject> OnParticleCollisionAsObservable()
		{
			Subject<GameObject> result;
			if ((result = this.onParticleCollision) == null)
			{
				result = (this.onParticleCollision = new Subject<GameObject>());
			}
			return result;
		}

		// Token: 0x060016B3 RID: 5811 RVA: 0x00062360 File Offset: 0x00060760
		private void OnParticleTrigger()
		{
			if (this.onParticleTrigger != null)
			{
				this.onParticleTrigger.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016B4 RID: 5812 RVA: 0x00062380 File Offset: 0x00060780
		public IObservable<Unit> OnParticleTriggerAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onParticleTrigger) == null)
			{
				result = (this.onParticleTrigger = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016B5 RID: 5813 RVA: 0x000623A8 File Offset: 0x000607A8
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onParticleCollision != null)
			{
				this.onParticleCollision.OnCompleted();
			}
			if (this.onParticleTrigger != null)
			{
				this.onParticleTrigger.OnCompleted();
			}
		}

		// Token: 0x04000CB8 RID: 3256
		private Subject<GameObject> onParticleCollision;

		// Token: 0x04000CB9 RID: 3257
		private Subject<Unit> onParticleTrigger;
	}
}
